home *** CD-ROM | disk | FTP | other *** search
- // EOAssociation.h
- // Enterprise Objects Framework
- // Copyright (c) 1993, NeXT Computer, Inc. All rights reserved.
-
- #import <foundation/NSDictionary.h>
-
- #import "EOController.h"
-
- #import <appkit/appkit.h>
-
-
- // These methods should be moved to the Appkit at some point. They allow
- // Control objects to accept and return NSString values.
-
- @interface Control (NSStringSupport)
- - (NSString *)string;
- - (void)setString: (NSString *)aString;
- @end
-
-
- // These methods should be moved to the Appkit at some point. They allow
- // ActionCell objects to accept and return NSString values.
-
- @interface ActionCell (NSStringSupport)
- - (NSString *)string;
- - (void)setString: (NSString *)aString;
- @end
-
-
- // An EOAssociation acts as the glue between user interface widgets and
- // properties of data-bearing objects. EOAssociations are held by
- // EOControllers. EOControllers may have many EOAssociations.
- // EOControllers manage activity between whatever provides allocation
- // and storage of the actual data-bearing objects (for example, an
- // EODatabaseDataSource), and the user interface through its
- // EOAssociations. An EOAssociation accomplishes its work by
- // intercepting action and delegation methods of a particular UI
- // widget--usually a subclass of Control. It can set values, get values, and
- // monitor selection.
- //
- // The EOAssociationNotification protocol is declared in EOController.h.
-
-
- @interface EOAssociation: NSObject <EOAssociationNotification>
- {
- id destination; // Either a widget or an EOController
- EOController *controller;
- NSString *key;
- }
-
- - initWithController:(EOController *)controller
- key:(NSString *)key
- destination:destination;
- // Initializes a newly allocated EOAssociation with controller. key is
- // used as the identifier for value transfers to and from destination
- // (a UI widget or another EOController).
-
- - (EOController *)controller;
- // Returns the controller responsible for the association.
-
- - destination;
- // Returns the association's destination object.
-
- - (NSString *)key;
- // Returns the key used as the identifier that the association transfers
- // to and from its destination.
-
- - value;
- // Returns the value of the association's destination. This is used by
- // the controller to set up the dictionary that will be passed to the
- // currently selected object.
-
- @end
-
- // EOAssociationClasses is implemented as a category on widgets to
- // determine if they are capable of displaying multiple items.
-
- @interface Object (EOAssociationClasses)
- - (Class)associationClass;
- // Widget classes should implement this method. It returns the subclass of
- // EOAssociation used by the widget.
-
- @end
-